using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SCS.Common.Models;
namespace SCS.DAL.Mapping
{
    public class SubjectMap : EntityTypeConfiguration<Subject>
    {
        public SubjectMap()
        {
            // Primary Key
            this.HasKey(t => t.subjectID);

            // Properties
            this.Property(t => t.subjectName)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("Subject");
            this.Property(t => t.subjectID).HasColumnName("subjectID");
            this.Property(t => t.subjectName).HasColumnName("subjectName");
        }
    }
}
